package com.qk.management.controller;

import com.qk.common.Result;
import com.qk.domain.UserLoginDO;
import com.qk.entity.User;
import com.qk.management.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 上官徵羽
 * @version 1.0
 * @since 2025-10-09 21:34
 */
@Slf4j
@RestController
@RequestMapping("/login")
@SuppressWarnings("all")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping
    public Result login(@RequestBody User user){
        UserLoginDO userLoginDO = loginService.loginVerification(user.getUsername(), user.getPassword());
        return Result.success(userLoginDO);
    }
}
